Integrand size = 32, antiderivative size = 95 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=-\frac {(3 i A-B) x}{4 a^2}+\frac {A \log (\sin (c+d x))}{a^2 d}+\frac {3 A+i B}{4 a^2 d (1+i \tan (c+d x))}+\frac {A+i B}{4 d (a+i a \tan (c+d x))^2} \]
[Out]
Time = 0.26 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.094, Rules used = {3677, 3612, 3556} \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\frac {3 A+i B}{4 a^2 d (1+i \tan (c+d x))}-\frac {x (-B+3 i A)}{4 a^2}+\frac {A \log (\sin (c+d x))}{a^2 d}+\frac {A+i B}{4 d (a+i a \tan (c+d x))^2} \]
[In]
[Out]
Rule 3556
Rule 3612
Rule 3677
Rubi steps \begin{align*} \text {integral}& = \frac {A+i B}{4 d (a+i a \tan (c+d x))^2}+\frac {\int \frac {\cot (c+d x) (4 a A-2 a (i A-B) \tan (c+d x))}{a+i a \tan (c+d x)} \, dx}{4 a^2} \\ & = \frac {3 A+i B}{4 a^2 d (1+i \tan (c+d x))}+\frac {A+i B}{4 d (a+i a \tan (c+d x))^2}+\frac {\int \cot (c+d x) \left (8 a^2 A-2 a^2 (3 i A-B) \tan (c+d x)\right ) \, dx}{8 a^4} \\ & = -\frac {(3 i A-B) x}{4 a^2}+\frac {3 A+i B}{4 a^2 d (1+i \tan (c+d x))}+\frac {A+i B}{4 d (a+i a \tan (c+d x))^2}+\frac {A \int \cot (c+d x) \, dx}{a^2} \\ & = -\frac {(3 i A-B) x}{4 a^2}+\frac {A \log (\sin (c+d x))}{a^2 d}+\frac {3 A+i B}{4 a^2 d (1+i \tan (c+d x))}+\frac {A+i B}{4 d (a+i a \tan (c+d x))^2} \\ \end{align*}
Time = 1.75 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.11 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=-\frac {(7 A+i B) \log (i-\tan (c+d x))-8 A \log (\tan (c+d x))+(A-i B) \log (i+\tan (c+d x))+\frac {2 (A+i B)}{(-i+\tan (c+d x))^2}-\frac {2 (-3 i A+B)}{-i+\tan (c+d x)}}{8 a^2 d} \]
[In]
[Out]
Time = 0.16 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.28
method | result | size |
risch | \(\frac {x B}{4 a^{2}}-\frac {7 i x A}{4 a^{2}}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} B}{4 a^{2} d}+\frac {{\mathrm e}^{-2 i \left (d x +c \right )} A}{2 a^{2} d}+\frac {i {\mathrm e}^{-4 i \left (d x +c \right )} B}{16 a^{2} d}+\frac {{\mathrm e}^{-4 i \left (d x +c \right )} A}{16 a^{2} d}-\frac {2 i A c}{a^{2} d}+\frac {A \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}\) | \(122\) |
derivativedivides | \(-\frac {A}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {i B}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {A \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \,a^{2}}-\frac {3 i A \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}+\frac {B \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}+\frac {B}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )}-\frac {3 i A}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )}+\frac {A \ln \left (\tan \left (d x +c \right )\right )}{a^{2} d}\) | \(152\) |
default | \(-\frac {A}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {i B}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {A \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \,a^{2}}-\frac {3 i A \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}+\frac {B \arctan \left (\tan \left (d x +c \right )\right )}{4 d \,a^{2}}+\frac {B}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )}-\frac {3 i A}{4 d \,a^{2} \left (\tan \left (d x +c \right )-i\right )}+\frac {A \ln \left (\tan \left (d x +c \right )\right )}{a^{2} d}\) | \(152\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.91 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=-\frac {{\left (4 \, {\left (7 i \, A - B\right )} d x e^{\left (4 i \, d x + 4 i \, c\right )} - 16 \, A e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) - 4 \, {\left (2 \, A + i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - A - i \, B\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{16 \, a^{2} d} \]
[In]
[Out]
Time = 0.27 (sec) , antiderivative size = 219, normalized size of antiderivative = 2.31 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\frac {A \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a^{2} d} + \begin {cases} \frac {\left (\left (4 A a^{2} d e^{2 i c} + 4 i B a^{2} d e^{2 i c}\right ) e^{- 4 i d x} + \left (32 A a^{2} d e^{4 i c} + 16 i B a^{2} d e^{4 i c}\right ) e^{- 2 i d x}\right ) e^{- 6 i c}}{64 a^{4} d^{2}} & \text {for}\: a^{4} d^{2} e^{6 i c} \neq 0 \\x \left (- \frac {- 7 i A + B}{4 a^{2}} + \frac {\left (- 7 i A e^{4 i c} - 4 i A e^{2 i c} - i A + B e^{4 i c} + 2 B e^{2 i c} + B\right ) e^{- 4 i c}}{4 a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (- 7 i A + B\right )}{4 a^{2}} \]
[In]
[Out]
Exception generated. \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
none
Time = 0.60 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.27 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=-\frac {\frac {2 \, {\left (A - i \, B\right )} \log \left (\tan \left (d x + c\right ) + i\right )}{a^{2}} + \frac {2 \, {\left (7 \, A + i \, B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} - \frac {16 \, A \log \left (\tan \left (d x + c\right )\right )}{a^{2}} - \frac {21 \, A \tan \left (d x + c\right )^{2} + 3 i \, B \tan \left (d x + c\right )^{2} - 54 i \, A \tan \left (d x + c\right ) + 10 \, B \tan \left (d x + c\right ) - 37 \, A - 11 i \, B}{a^{2} {\left (\tan \left (d x + c\right ) - i\right )}^{2}}}{16 \, d} \]
[In]
[Out]
Time = 7.37 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.36 \[ \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^2} \, dx=\frac {\frac {B}{2\,a^2}-\frac {A\,1{}\mathrm {i}}{a^2}+\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {3\,A}{4\,a^2}+\frac {B\,1{}\mathrm {i}}{4\,a^2}\right )}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}+2\,\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}+\frac {A\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a^2\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )}{8\,a^2\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (7\,A+B\,1{}\mathrm {i}\right )}{8\,a^2\,d} \]
[In]
[Out]